﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using VPBS.Common;

namespace VPBS.Informix.DAL
{
    public class ThdHolydayDateDAL
    {
        /// <summary>
        /// Kiem tra ngay nghi
        /// </summary>
        /// <param></param>
        /// <returns>PhoneNumber
        /// = True -> Ngay nghi
        /// = False -> Ngay giao dich
        /// </returns>
        public static bool CheckOfHolydayDate()
        {
            try
            {
                string command = "select holidaydate from thd where year(holidaydate) = year(today) and holidaydate = today";

                DataSet ds = InformixOdbcHelper.ExecuteDataset(ConnectStringHelper.InfxOdbcConnectionString, CommandType.Text,
                                                   command);
                if ((ds != null && ds.Tables[0].Rows.Count > 0) || DateTime.Now.DayOfWeek.ToString().ToUpper() == "SATURDAY" || DateTime.Now.DayOfWeek.ToString().ToUpper() == "SUNDAY")
                    return true;
                return false;
            }
            catch (Exception ex)
            {
                //Logger.Error(typeof(Get_PhoneNumber), ex);
                return false;
            }
        }
    }
}
